package cn.tedu.shoot;
import java.util.Random;
import java.awt.image.BufferedImage;
public class Bee extends FlyingObject implements Award{
	private int xspeed;
	private int yspeed;
	private int awardType;
	public Bee(){
		super(60,50);
		xspeed = 2;
		yspeed = 2;
		Random rand = new Random();
		awardType = rand.nextInt(2);
	}
	public void step() {
		if(this.x>World.WIDTH-this.width||this.x<=0) {
			xspeed*=-1;
		}
		x+=xspeed;
		y+=yspeed;
	}
	int index = 1;
	public BufferedImage getImage(){
		if(isLife()) {
			return Images.bees[0];
		}else if(isDead()) {
			BufferedImage img = Images.bees[index++];
			if(index==Images.bees.length) {
				state=REMOVE;
			}
			return img;
		}
		return null;
	}
	
	public int getAwardType() {
		return awardType;
	}

	
}
